// function slideshow () {
//     $.ajax({
//         type:get,
//         url:'http://192.168.151.94:8888/api/swipers',
//         success:function (res) {

//         }
//     })
// }

layui.use ('carousel', function () {
  let carousel = layui.carousel
  function slideshow () {
      $.ajax ({
          type: 'get',
          url: 'http://192.168.151.94:8888/api/swipers',
          success: function (res) {
              if (res.status === 0) {
                  let arr = []
                  res.data.forEach(function (item) {
                      arr.push(`
                      <li class="img-effect">
                      <a href="javascript:;">
                        <img src="${'http://192.168.151.94:8888/uploads/' + item.swiperimg}">
                      </a>
                    </li>
                    `)
                  })
                  $('#kr_carousel ul').html(arr.join(''))
                  carousel.render({
                    elem: '#kr_carousel',
                    width: 720,
                    height: 300,
                    interval: 3000
                  });
              }
          }
      })
      
  }
  slideshow ()

  function blogroll () {
      $.ajax ({
          type: 'get',
          url: 'http://192.168.151.94:8888/api/links',
          success: function (res) {
              if (res.status === 0) {
                  let arr = []
                  res.data.forEach(function (item) {
                      arr.push(`
                      <a href="javascript:;">
                      <img src="${'http://192.168.151.94:8888/uploads/' + item.linkicon}" >
                    </a>
                  </dd>
                  `)
                  $('.kr_collaborator dt').html(arr.join(''))
                  }) 
              }
          }
      })
  }
  blogroll () 

})

